import http from './interface'


/**
 * 将业务所有接口统一起来便于维护
 * 如果项目很大可以将 url 独立成文件，接口分成不同的模块
 * 
 */
// 单独导出(测试接口) import {test} from '@/common/vmeitime-http/'
export const test = (data) => {
	/* http.config.baseUrl = "http://localhost:8080/api/"
	//设置请求前拦截器
	http.interceptor.request = (config) => {
		config.header = {
			"token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
		}
	} */
	//h%3C%EA%FE%E2%81%F0%0D%A8%24%D5%8E%F5u%13%23%0D%B8%D6%60H%CEYE
	//设置请求结束后拦截器
	http.interceptor.response = (response) => {
		console.log('个性化response....')
		//判断返回状态 执行相应操作
		return response;
	}
    return http.request({
		baseUrl: 'https://unidemo.dcloud.net.cn/',
        url: 'ajax/echo/text?name=uni-app',
		dataType: 'text',
        data,
    })
}
export const getType = () => {
    return http.request({
        url: '/GetAllType',
        method: 'GET'
    })
}
export const getInfo =(id,page) =>{
	return http.request({
	    url: '/v2/GetAllInfoGzip?'+'id='+id+'&page='+page,
	    method: 'GET',
	})
	}
export const searchKey =(key)=>{
	return http.request({
		url:'/SearchKey?key='+key,
		method:'GET'
	})
}
export const getRssHub =(url)=>{
	return http.request({
		baseUrl:'http://120.79.55.82:1200/',
		url:url,
		method:'GET'
	})
}

// 默认全部导出  import api from '@/common/vmeitime-http/'
export default {
	getType,
	getInfo,
	searchKey,
	getRssHub
}